package com.mofang.controller;

import java.util.ArrayList;

import com.mofang.model.InteractiveKnowledgeModel;
import com.pactera.framework.controller.BaseController;
import com.pactera.framework.exception.IException;
import com.pactera.framework.model.MapEntity;

public class InteractiveController extends BaseController {
	
	/**	获取知识互动 */
	private static final int Get_Interactive_Knowledge_key = 6;
	
	/**	获取办证互动 */
	private static final int Get_Interactive_Accreditation_key = 6;
	
	/**	获取贷款互动 */
	private static final int Get_Interactive_Loan_key = 6;
	
	/**
	 * 获取知识互动
	 * @param viewUpdateCallback
	 * @param userId
	 */
	public void getKnowledge(
			final UpdateViewAsyncCallback<ArrayList<MapEntity>> viewUpdateCallback,
			 final String userId) {
		doAsyncTask(Get_Interactive_Knowledge_key, viewUpdateCallback,
				new DoAsyncTaskCallback<String, ArrayList<MapEntity>>() {
					@Override
					public ArrayList<MapEntity> doAsyncTask(String... params)
							throws IException {
						// throw new ServerException();
						final InteractiveKnowledgeModel model = new InteractiveKnowledgeModel();
						return model.getKnowledgeCommunicationList(params[0]);
					}
				}, userId);

	}

	public void cancelGetKnowledge() {
		cancel(Get_Interactive_Knowledge_key);
	}
	
	
}
